
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 2710
 * @Author : WangRuoyu 
 * @Date : 2023/5/29 10:41
 */

#include "iostream"

using namespace std;

class Solution {
public:
    string removeTrailingZeros(string num) {
        int idx = num.size();
        while (idx > 0) {
            if (num[idx - 1] == '0') {
                idx--;
            } else {
                break;
            }
        }
        return num.substr(0, idx);
    }
};

int main() {
    Solution sl;
    string num = "51230100";
    cout << sl.removeTrailingZeros(num);
    return 0;
}